home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / et / et3_0-a1.lha / et3 / src / Filler.C < prev    next >
C/C++ Source or Header  |  1992-05-05  |  1KB  |  59 lines

  1. #ifdef __GNUG__
  2. #pragma implementation
  3. #endif
  4.  
  5. #include "Filler.h"
  6.  
  7. #include "Class.h"
  8.  
  9. //---- Filler ------------------------------------------------------------------
  10.  
  11. NewMetaImpl(Filler,VObject, (T(minsize), TP(ink)));
  12.  
  13. Filler::Filler(Point extent, int flags)
  14. {   
  15.     ink= gInkNone;
  16.     contentRect.extent= minsize= extent;
  17.     SetFlag(flags & (eVObjHFixed | eVObjVFixed));
  18. }
  19.  
  20. Filler::Filler(Point extent, Ink *ik, int flags)
  21. {   
  22.     ink= ik;
  23.     contentRect.extent= minsize= extent;
  24.     SetFlag(flags & (eVObjHFixed | eVObjVFixed));
  25. }
  26.  
  27. Metric Filler::GetMinSize()
  28. {
  29.     return Metric(minsize);
  30. }
  31.  
  32. void Filler::Draw(Rectangle r)
  33. {
  34.     if (ink != ePatNone)
  35.     GrPaintRect(r, ink);
  36. }
  37.  
  38. Ink *Filler::SetInk(Ink *ik, bool redraw)
  39. {
  40.     Ink *oldink= ink;
  41.     ink= ik;
  42.     if (redraw)
  43.     ForceRedraw();
  44.     return oldink;
  45. }
  46.  
  47. OStream& Filler::PrintOn(OStream &s)
  48. {
  49.     VObject::PrintOn(s);
  50.     return s << minsize SP << ink SP;
  51. }
  52.  
  53. IStream& Filler::ReadFrom(IStream &s)
  54. {
  55.     VObject::ReadFrom(s);
  56.     return s >> minsize >> ink;
  57. }
  58.  
  59.